Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impala with Sentry authorization: User '' does not have privileges to execute 'SELECT' #4240

Closed
powelleric opened this issue Sep 19, 2018 · 4 comments

Comments

@powelleric
Copy link

powelleric commented Sep 19, 2018

I have a new Impala database with Sentry authorization enabled. I was able to create the connection and it seemed ok when clicking 'Test connection' however, I did not see the database in the dropdown under the connection in the object explorer.

Moreover, when I try to run a query I get an error like this:
errorMessage:AuthorizationException: User '' does not have privileges to execute 'SELECT' on: db.table
It is interesting because it looks like it is not getting the name of the user (e.g empty quotes). I tried adding my username to the jdbc connection string like this: jdbc:impala://impala1:21050;UID=IMPALA_USER; but it didn't help.

Seems related to this: https://community.cloudera.com/t5/Interactive-Short-cycle-SQL/Impala-queries-through-impala-JDBC-is-running-with-empty/td-p/49964

@powelleric
Copy link
Author

powelleric commented Sep 25, 2018

After reading the manual, I corrected my connection string to be:

jdbc:impala://impala_ip:21050/mydb;AuthMech=2;UID=myuser

Now, when I do 'Test Connection...' it just hangs forever at: Connect to [my connection string]: Connecting Main

To clarify, I am trying to connect to an Impala instance with Sentry enabled. I do not use a password to connect. I am not using LDAP. Sentry is just providing a permission system based on linux username.

If I remove the bit after mydb and try Test Connection it works fine and says it is connected and I can see it go through the 'Extract Schema' step but then queries don't work. Here is the error I get in that case:

Query execution failed

Reason:
SQL Error [500051] [HY000]: [Simba][ImpalaJDBCDriver](500051) ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, errorMessage:AuthorizationException: User '' does not have privileges to execute 'SELECT' on: mydb.mytable
), Query: select * from mydb.mytable limit 1.

@lyc751
Copy link

lyc751 commented Dec 6, 2018

Same issue.
Solved by connection string like this:
jdbc:impala://impala_ip:21050/mydb;AuthMech=3;UID=myuser;PWD=whatever;UseSasl=0
Gook Luck!

@powelleric
Copy link
Author

Unfortunately, that did not work for me. I am using AuthMech=2; Authentication with username but no password. After adding UseSasl=0, I still hangs as before.

@powelleric
Copy link
Author

Finally got it thanks to some new activity on this thread. The answer was simply leaving the password field blank:

jdbc:impala://1.0.0.1:21050/mydb;AuthMech=3;UID=myuser;UseSasl=0;PWD=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants